package org.carpediem.conman.rest;

import org.carpediem.conman.entity.Contact;

import javax.ws.rs.core.UriInfo;
import java.net.URI;

/**
 * @author Mark Petrovic
 */
public abstract class RestBase {
    protected final UriInfo uriInfo;

    protected RestBase(UriInfo uriInfo) {
        this.uriInfo = uriInfo;
    }

    protected URI uri(Contact e) {
        return uriInfo.getBaseUriBuilder().path(ContactResource.class).build(e.getId());
    }
}
